Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'a test button click event to check if the Opera exe is running'
        If ChkExeExist("opera") Then
            MessageBox.Show("Exe is open")
        Else
            MessageBox.Show("Exe is not open")
        End If
    End Sub
    Public Function ChkExeExist(ByVal strName As String) As Boolean
        '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
        '               Check if exe exist in process list                           '
        '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

        ChkExeExist = False 'default variable value
        Dim clsProcess As New Process   'create new instance of class process
        For Each clsProcess In Process.GetProcesses 'list all the processes
            If clsProcess.ProcessName = strName Then    'compare the process name with the name we give
                'if we found even 1 process with the same name return true and exit the function
                Return True
                Exit Function
            End If
        Next
    End Function
End Class